from scapy.all import *
from pyDiameter.pyDiaMessage import DiaMessage
from pyDiameter.pyDiaAVPTypes import DiaAVPStr
from pyDiameter.pyDiaAVPPath import DiaAVPPath
import base64


path= 'D:/python/diameter/data/diameter.pcap'
pcap_pkts = rdpcap(path)

i = 0
for packet in pcap_pkts:
    # packet.show()
    # i=i+1
    # print(i)
    beginning=packet['SCTPChunkData'].beginning
    ending=packet['SCTPChunkData'].ending
    tsn=packet['SCTPChunkData'].tsn
    print(beginning,ending,tsn)
    # print(packet['SCTPChunkData'].data)
    # decode_data=packet['SCTPChunkData'].data
    # decode_data=str(decode_data, encoding="utf-8")
    # print(decode_data)
    # print(decode_data[7])
    # print(decode_data.decode('hex'))
